CFILE := $(wildcard *.c)
SFILE := $(wildcard *.S)

COBJFILE := $(patsubst %.c,%.o,$(CFILE))
SOBJFILE := $(patsubst %.S,%.o,$(SFILE))

build.out: $(COBJFILE) $(SOBJFILE)
	ld -T hello.lds $^ -o $@

%.o: %.c
	gcc -c $^ -o $@
%.o: %.S
	gcc -c $^ -o$@

b: build.out
clean:
	rm *.o
	rm *.out
c: clean